﻿#region License

/*
 © 2012 Alex Kazaev
 * FolderDrive project [http://folderdrive.codeplex.com/]
 * Licensed under Ms-PL license [http://www.opensource.org/licenses/MS-PL]
 */

#endregion License

namespace FolderDrive.ViewModels
{
  /// <summary>
  /// Class thet represents single item of drive mappings
  /// </summary>
  public class MappingPreferenceItem : BaseViewModel
  {
    #region fields

    private string driveLetter;
    private bool isSelected;
    private bool isPermanent;

    #endregion fields

    #region properties

    /// <summary>
    /// Gets or sets the drive letter.
    /// </summary>
    public string DriveLetter
    {
      set { driveLetter = value.ToUpper(); }
      get { return driveLetter; }
    }

    /// <summary>
    /// Gets or sets a value indicating whether this <see cref="MappingPreferenceItem"/> is selected.
    /// </summary>
    public bool Selected
    {
      set
      {
        isSelected = value;
        NotifyChanged("Selected");
      }
      get { return isSelected; }
    }

    /// <summary>
    /// Gets or sets the permanent flag
    /// </summary>
    public bool IsPermanent
    {
      set
      {
        isPermanent = value;
        NotifyChanged("IsPermanent");
      }
      get
      {
        return isPermanent;
      }
    }

    /// <summary>
    /// Gets or sets the path.
    /// </summary>
    public string Path { set; get; }

    #endregion properties

    #region constructor

    /// <summary>
    /// Initializes a new instance of the <see cref="MappingPreferenceItem"/> class.
    /// </summary>
    /// <param name="letter">The drive letter.</param>
    /// <param name="path">The path.</param>
    /// <param name="permanent">determines if the mapping is permanent</param>
    public MappingPreferenceItem(string letter, string path, bool permanent)
    {
      DriveLetter = letter.ToUpper();
      Path = path;
      IsPermanent = permanent;
    }

    #endregion constructor
  }
}